/*
* @File Name freecars.h
* @File Path M:\MAS2\PRM_Robotic_Arm\PRMCcode\coding\freecars\freecars.h
* @Author: Jiejun Huang
* @Date:   2014
* @Last Modified by:   Ruige_Lee
* @Last Modified time: 2019-04-19 10:13:56
* @Email: 295054118@whut.edu.cn"
*/






#ifndef _FREECARS_H_
#define _FREECARS_H_

#include <stdint.h>

extern int32_t uart_hw_setup();
extern void Uart_Putchar( uint8_t data );
extern uint8_t UART_GetChar(); 
extern void Uart_printf(uint8_t * str);
extern void task_rec();

#define UartDataNum      12

#define UartRxBufferLen  100
#define UartRxDataLen    41          
#define UartRxCmdLen     7	      

#define UartCmdNum  SerialPortRx.Buffer[SerialPortRx.Stack - 3]
#define UartCmdData SerialPortRx.Buffer[SerialPortRx.Stack - 2]


typedef struct 
{
	int32_t Stack;
	uint8_t Data;
	uint8_t PreData;
	uint8_t Buffer[UartRxBufferLen];
	uint8_t Enable;
	uint8_t Check;
}SerialPortType;



extern uint8_t uSendBuf[UartDataNum * 2];
extern SerialPortType SerialPortRx;
extern double UartData[9];

extern void UartDebug();
extern void UartCmd( uint8_t cmdnum, uint8_t cmddata );
extern void sendDataToScope();
extern void push( uint8_t, uint16_t );
extern void freecars_isr(void);

#endif 


